#tag Window
Begin Window testRunner
   BackColor       =   16777215
   Backdrop        =   ""
   BalloonHelp     =   ""
   CloseButton     =   "True"
   Composite       =   "False"
   Frame           =   0
   FullScreen      =   "False"
   HasBackColor    =   "False"
   Height          =   538
   ImplicitInstance=   "True"
   LiveResize      =   "False"
   MacProcID       =   0
   MaxHeight       =   32000
   MaximizeButton  =   "False"
   MaxWidth        =   32000
   MenuBar         =   ""
   MenuBarVisible  =   "True"
   MinHeight       =   400
   MinimizeButton  =   "True"
   MinWidth        =   800
   Placement       =   0
   Resizeable      =   "False"
   Title           =   "TestRunner"
   Visible         =   "True"
   Width           =   832
   Begin EditField edtPassed
      AcceptTabs      =   ""
      Alignment       =   0
      AutoDeactivate  =   "True"
      BackColor       =   16777215
      Bold            =   ""
      Border          =   "True"
      ControlOrder    =   0
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Format          =   ""
      Height          =   119
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LimitText       =   0
      LockBottom      =   "True"
      LockLeft        =   "True"
      LockRight       =   "True"
      LockTop         =   "True"
      Mask            =   ""
      Multiline       =   "True"
      Password        =   ""
      ReadOnly        =   ""
      Scope           =   0
      ScrollbarHorizontal=   ""
      ScrollbarVertical=   "True"
      Styled          =   ""
      TabPanelIndex   =   0
      Text            =   ""
      TextColor       =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   40
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   True
      Width           =   800
      BehaviorIndex   =   0
   End
   Begin GroupBox gbxStatistics
      AutoDeactivate  =   "True"
      Bold            =   ""
      Caption         =   "Unittest Statistics"
      ControlOrder    =   1
      Enabled         =   True
      Height          =   133
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   "True"
      LockLeft        =   "True"
      LockRight       =   "True"
      LockTop         =   ""
      Scope           =   0
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   353
      Underline       =   ""
      Visible         =   True
      Width           =   792
      BehaviorIndex   =   1
      Begin StaticText txtPassedCaption
         AutoDeactivate  =   "True"
         Bold            =   "False"
         ControlOrder    =   2
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   30
         LockBottom      =   ""
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   "True"
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   "Passed Tests"
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   391
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   2
      End
      Begin StaticText txtPassed
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   3
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   142
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   ""
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   391
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   3
      End
      Begin StaticText txtFailedCaption
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   4
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   30
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   "False"
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   "Failed Tests"
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   423
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   4
      End
      Begin StaticText txtFailed
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   5
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   142
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   ""
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   423
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   5
      End
      Begin StaticText txtTotalCaption
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   6
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   30
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   ""
         LockTop         =   "True"
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   "Total Tests"
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   455
         Underline       =   ""
         Visible         =   True
         Width           =   100
         BehaviorIndex   =   6
      End
      Begin StaticText txtTotal
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   7
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   142
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   ""
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   455
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   7
      End
      Begin StaticText txtClassesCaption
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   8
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   341
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   "Classes tested"
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   391
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   8
      End
      Begin StaticText txtMethodsCaption
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   9
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   341
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   "Methods tested"
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   423
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   9
      End
      Begin StaticText txtClasses
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   10
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   467
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   ""
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   391
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   10
      End
      Begin StaticText txtMethods
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   11
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   467
         LockBottom      =   "True"
         LockLeft        =   "True"
         LockRight       =   "True"
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   ""
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   423
         Underline       =   ""
         Visible         =   True
         Width           =   150
         BehaviorIndex   =   11
      End
      Begin StaticText StaticText3
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   15
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   341
         LockBottom      =   ""
         LockLeft        =   ""
         LockRight       =   ""
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   "Time"
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   455
         Underline       =   ""
         Visible         =   True
         Width           =   100
         BehaviorIndex   =   12
      End
      Begin StaticText txtTime
         AutoDeactivate  =   "True"
         Bold            =   ""
         ControlOrder    =   16
         DataField       =   ""
         DataSource      =   ""
         Enabled         =   True
         Height          =   20
         HelpTag         =   ""
         Index           =   -2147483648
         InitialParent   =   "gbxStatistics"
         Italic          =   ""
         Left            =   467
         LockBottom      =   ""
         LockLeft        =   ""
         LockRight       =   ""
         LockTop         =   ""
         Multiline       =   ""
         Scope           =   0
         TabPanelIndex   =   0
         Text            =   ""
         TextAlign       =   0
         TextColor       =   0
         TextFont        =   "System"
         TextSize        =   0
         Top             =   455
         Underline       =   ""
         Visible         =   True
         Width           =   164
         BehaviorIndex   =   13
      End
   End
   Begin PushButton btnRun
      AutoDeactivate  =   "True"
      Bold            =   ""
      Cancel          =   ""
      Caption         =   "Run Unittests"
      ControlOrder    =   12
      Default         =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   687
      LockBottom      =   "True"
      LockLeft        =   ""
      LockRight       =   "True"
      LockTop         =   ""
      Scope           =   0
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   498
      Underline       =   ""
      Visible         =   True
      Width           =   125
      BehaviorIndex   =   14
   End
   Begin EditField edtFailed
      AcceptTabs      =   ""
      Alignment       =   0
      AutoDeactivate  =   "True"
      BackColor       =   16777215
      Bold            =   ""
      Border          =   "True"
      ControlOrder    =   13
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Format          =   ""
      Height          =   125
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LimitText       =   0
      LockBottom      =   "True"
      LockLeft        =   "True"
      LockRight       =   "True"
      LockTop         =   "False"
      Mask            =   ""
      Multiline       =   "True"
      Password        =   ""
      ReadOnly        =   ""
      Scope           =   0
      ScrollbarHorizontal=   ""
      ScrollbarVertical=   "True"
      Styled          =   ""
      TabPanelIndex   =   0
      Text            =   ""
      TextColor       =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   198
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   True
      Width           =   800
      BehaviorIndex   =   15
   End
   Begin StaticText StaticText1
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   14
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   ""
      LockLeft        =   "True"
      LockRight       =   ""
      LockTop         =   "True"
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Passed"
      TextAlign       =   0
      TextColor       =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   8
      Underline       =   ""
      Visible         =   True
      Width           =   100
      BehaviorIndex   =   16
   End
   Begin StaticText StaticText2
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   17
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   16
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   "True"
      LockLeft        =   "True"
      LockRight       =   ""
      LockTop         =   "False"
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Failed"
      TextAlign       =   0
      TextColor       =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   175
      Underline       =   ""
      Visible         =   True
      Width           =   100
      BehaviorIndex   =   17
   End
   Begin PushButton btnShow
      AutoDeactivate  =   "True"
      Bold            =   ""
      Cancel          =   ""
      Caption         =   "Show..."
      ControlOrder    =   18
      Default         =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   562
      LockBottom      =   "True"
      LockLeft        =   ""
      LockRight       =   "True"
      LockTop         =   ""
      Scope           =   0
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   498
      Underline       =   ""
      Visible         =   True
      Width           =   113
      BehaviorIndex   =   18
   End
End
#tag EndWindow

#tag WindowCode
#tag EndWindowCode

#tag Events btnRun
	#tag Event
		Sub Action()
		  if unitTests.total <> 0 then
		    dim modDlg as new MessageDialog
		    dim btn as MessageDialogButton
		    modDlg.Icon = MessageDialog.GraphicQuestion
		    modDlg.ActionButton.Caption = "Reset"
		    modDlg.CancelButton.Visible = True
		    modDlg.Message = "Do you want to rerun unit-tests?"
		    modDlg.Explanation = "This will set back the statistics and rerun all unittests."
		    btn = modDlg.ShowModalWithin(testRunner)
		    
		    select case btn
		    case modDlg.ActionButton
		      unitTests.reset
		      edtPassed.Text = ""
		      edtFailed.Text = ""
		      app.Dbg = ""
		      app.randomAI = 0
		      app.decissionAI = 0
		      app.tie = 0
		      app.highestD = -1
		      app.highestR = -1
		      unitTests.run
		    case modDlg.CancelButton
		      //nothing
		    end select
		  else
		    unitTests.Run
		  end if
		End Sub
	#tag EndEvent
#tag EndEvents
#tag Events btnShow
	#tag Event
		Sub Action()
		  winMain.Visible = true
		End Sub
	#tag EndEvent
#tag EndEvents
